/*  1:   */ package org.intellij.plugins.relaxNG.references;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.util.Key;
import com.intellij.patterns.PatternCondition;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;

import java.util.Set;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */ 
/*  9:   */ class AddValueCondition<T>
/* 10:   */   extends PatternCondition<T>
/* 11:   */ {
/* 12:   */   private final Key<? extends Set<T>> a;
/* 13:   */   
/* 14:   */   public AddValueCondition(Key<? extends Set<T>> paramKey)
/* 15:   */   {
/* 16:30 */     super("AddValue");
/* 17:31 */     this.a = paramKey;
/* 18:   */   }
/* 19:   */   
/* 20:   */   public static <T> AddValueCondition<T> create(Key<? extends Set<T>> paramKey)
/* 21:   */   {
/* 22:35 */     return new AddValueCondition(paramKey);
/* 23:   */   }
/* 24:   */   
/* 25:   */   public boolean accepts(@NotNull T paramT, ProcessingContext paramProcessingContext)
/* 26:   */   {
/* 27:39 */     if (paramT == null) {
/* 28:39 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/references/AddValueCondition", "accepts" }));
/* 29:   */     }
/* 30:39 */     ((Set)paramProcessingContext.get(this.a)).add(paramT);
/* 31:40 */     return true;
/* 32:   */   }
/* 33:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.references.AddValueCondition

 * JD-Core Version:    0.7.0.1

 */